#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：图灵学习 
@File    ：20.异步上下文管理器.py
@IDE     ：PyCharm 
@Author  ：ChenLiGao
@Date    ：2024-11-11 10:01
'''
import asyncio

import aiohttp, aiomysql

async def get_baidu_htmml():
    async with aiohttp.ClientSession() as session:
        async with session.get("https://www.baidu.com") as response:
            res = await response.text()
            print(res)

asyncio.run(get_baidu_htmml())
